At a recent lecture at the Boston College School of Law, former Gov. Martin O’Malley outlined what he described as a “principled response” to Trumpism and the threats to our democratic institutions it represents. Among his prescriptions: a state-by-state effort to end the gerrymandering of congressional districts, “a system that drives our representatives apart ... has wiped out diversity of opinions ... [and] digs ideological trenches around incumbents.”

Marylanders who caught wind of this might be excused for thinking, “That’s rich.”

The notion that it was damaging our democracy to use highly sophisticated computer mapping and micro-targeting of voters to shape congressional districts to one party’s advantage wasn’t exactly news when Mr. O’Malley got the chance to reshape Maryland’s political map after the 2010 census. For years, it had been clear that the two pernicious tactics of the gerrymander — packing huge numbers of voters of the party you want to hurt into a few districts or diluting their power by spreading them out among many districts — was fueling the forces of extremism on both ends of the political spectrum. Members of Congress had little to fear in general elections but lived in terror of primary challenges, leading the House away from compromise and toward sclerotic partisanship.

If the national trend wasn’t clear, Mr. O’Malley needed to look no further than the 1st Congressional District, which became a dumping ground for Republican voters in then-Gov. Parris N. Glendening’s remapping of 2002. The moderate GOP incumbent, Wayne T. Gilchrest, hung on for a few election cycles until he was challenged in the 2008 primary by a much more consistently conservative Republican, Andy Harris. Dr. Harris won the primary only to narrowly lose the general election to a moderate, Frank Kratovil, in what was a banner year for Democrats. Dr. Harris was back in 2010 (the year of the tea party wave), and he won handily.

Rather than redraw the lines to make the 1st District more competitive, Mr. O’Malley actually solidified Dr. Harris’ position. He packed the district with Republicans to help Maryland’s incumbent Democrats, some of whom in turn picked up Western Maryland Republican voters for their districts to help make the 6th District competitive. The plan worked. Dr. Harris is safe but alone; he is the only Republican in Maryland’s House delegation — a group that was split 4-4 as recently as 2001. Meanwhile, Mr. O’Malley was able to bolster his position with national Democrats in advance of his presidential run.

But rather than branding Mr. O’Malley a convenient convert on the matter, we see in the reasons for his change of heart a strong argument that Maryland Democrats ought to heed. The premise of his talk in Boston was that American democracy is in trouble — from unlimited money in politics, a national media that too often pursues ratings over solid reporting, from voter apathy and disenfranchisement and from President Donald Trump, who shows little regard for democratic institutions.

“The future of our country will now depend on the resilience of our democratic institutions — including our press — and the courage of individual men and women who serve in those institutions,” Mr. O’Malley said.

We urge Mr. O’Malley to show a bit of that courage himself. Gov. Larry Hogan has long been a proponent of scrapping Maryland’s governor-centric redistricting process in favor of one delegated to a nonpartisan commission, but his efforts have gone nowhere in the legislature. This year’s versions are up for hearings on March 2 in the Senate and March 3 in the House. Mr. O’Malley should team up with Governor Hogan to testify in favor of the legislation.

While they’re at it, they should pull in Rep. Anthony G. Brown, who served as Mr. O’Malley’s lieutenant governor and endorsed redistricting reform in his losing campaign against Governor Hogan. Sen. Ben Cardin could join the panel, too. In an interview last week with The Sun’s editorial board, Senator Cardin called it “unfair to divide communities” in the way current redistricting practices do and advocated for a nonpartisan approach. Democrats would “come out just fine” under such a system, he said.

Maryland Democrats have opposed engaging in what they consider unilateral disarmament — they figure, why should they give up a Democratic seat (or more) in Maryland when Republicans in places like Texas, Virginia and North Carolina aren’t going to do the same? That’s why they need to hear Mr. O’Malley’s message of principled opposition. President Trump won office by arguing that both parties are corrupt and self serving and saying only he could fix what’s broken in Washington. By adopting some of the most severely gerrymandered districts in the nation to squeeze out one more Democratic seat, Maryland Democrats aren’t fighting President Trump. They’re playing right into his hands.